package com.ruoyi.system.service.community.impl;

import java.util.List;

import com.ruoyi.common.config.HeadNum;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.domain.communiry.FzSCommunity;
import com.ruoyi.system.mapper.community.FzSCommunityMapper;
import com.ruoyi.system.service.community.IFzSCommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 小区Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-02-26
 */
@Service
public class FzSCommunityServiceImpl implements IFzSCommunityService
{
    @Autowired
    private FzSCommunityMapper fzSCommunityMapper;

    /**
     * 查询小区
     * 
     * @param communityId 小区ID
     * @return 小区
     */
    @Override
    public FzSCommunity selectFzSCommunityById(String communityId)
    {
        return fzSCommunityMapper.selectFzSCommunityById(communityId);
    }

    /**
     * 查询小区列表
     * 
     * @param fzSCommunity 小区
     * @return 小区
     */
    @Override
    public List<FzSCommunity> selectFzSCommunityList(FzSCommunity fzSCommunity)
    {
        return fzSCommunityMapper.selectFzSCommunityList(fzSCommunity);
    }

    /**
     * 新增小区
     * 
     * @param fzSCommunity 小区
     * @return 结果
     */
    @Override
    public int insertFzSCommunity(FzSCommunity fzSCommunity)
    {
        fzSCommunity.setCreateTime(DateUtils.getNowDate());
        return fzSCommunityMapper.insertFzSCommunity(fzSCommunity);
    }

    /**
     * 修改小区
     * 
     * @param fzSCommunity 小区
     * @return 结果
     */
    @Override
    public int updateFzSCommunity(FzSCommunity fzSCommunity)
    {
        fzSCommunity.setUpdateTime(DateUtils.getNowDate());
        return fzSCommunityMapper.updateFzSCommunity(fzSCommunity);
    }

    /**
     * 删除小区对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzSCommunityByIds(String ids)
    {
        return fzSCommunityMapper.deleteFzSCommunityByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除小区信息
     * 
     * @param communityId 小区ID
     * @return 结果
     */
    @Override
    public int deleteFzSCommunityById(String communityId)
    {
        return fzSCommunityMapper.deleteFzSCommunityById(communityId);
    }
}
